<?php
use yii\helpers\Url;
use yii\widgets\LinkPager;
use yii\helpers\Html;
use common\helpers\HtmlHelper;

$this->title = '商品';
$this->params['breadcrumbs'][] = ['label' => '客户列表', 'url' => ['merchant/index']];
$this->params['breadcrumbs'][] = ['label' => $this->title];
?>

<div class="row">
    <div class="col-xs-12">
        <div class="box">
            <div class="box-header">
                <h3 class="box-title"><?= $this->title; ?></h3>
                <div class="box-tools">
                </div>
            </div>
            <div class="box-body table-responsive">
                <table class="table table-hover">
                    <thead>
                    <tr>
                        <th>#</th>
                        <th>图片</th>
                        <th>商品名称</th>
                        <th>编码</th>
                        <th>条码</th>
                        <th>分类</th>
                        <th>品牌</th>
                        <th>价格</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php foreach($models as $model){ ?>
                        <tr id="<?= $model->goods_commonid ?>">
                            <td><?= $model->goods_commonid ?></td>
                            <td>
                                <?= HtmlHelper::imageFancyBox($model->goods_image)?>
                            </td>
                            <td><?= Html::encode($model->goods_name) ?></td>
                            <td><?= Html::encode($model->goods_code) ?></td>
                            <td><?= Html::encode($model->goods_bar) ?></td>
                            <td><?= Html::encode($model->gclass->name??'') ?></td>
                            <td><?= Html::encode($model->brand->name??'') ?></td>
                            <td><?= $model->goods_price ?></td>
                            <td>
                                <?= HtmlHelper::status($model['status']); ?>
                                <?= HtmlHelper::delete(['destroy','id' => $model->goods_commonid, 'store_id' => $store_id])?>
                            </td>
                        </tr>
                    <?php } ?>
                    </tbody>
                </table>
            </div>
            <div class="box-footer">
                <?= LinkPager::widget([
                    'pagination' => $pages
                ]);?>
            </div>
        </div>
    </div>
</div>
